<?php
// +----------------------------------------------------------------------
// | 海豚PHP框架 [ DolphinPHP ]
// +----------------------------------------------------------------------
// | 版权所有 2016~2017 河源市卓锐科技有限公司 [ http://www.zrthink.com ]
// +----------------------------------------------------------------------
// | 官方网站: http://dolphinphp.com
// +----------------------------------------------------------------------
// | 开源协议 ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------

namespace app\shop\model;

use think\Model;


class ShopStatus extends Model
{
    public static function getShowType(){
        $show = [0=>'混合展示',1=>'独立展示'];
        return $show;
    }
    public static function getStatus(){
        $status = [0=>'待审核',1=>'已审核'];
        return $status;
    }

   public static function getStatusAttr($value=99){
       $status = [0=>'待审核',1=>'已审核'];
       return array_key_exists($value,$status) ? $status[$value] : '';
   }
    public static function getIsEnable(){
        $status = [0=>'禁用',1=>'启用'];
        return $status;
    }

    public static function getShopIsEnable($value=99){
        $status = [0=>'禁用',1=>'启用'];
        return array_key_exists($value,$status) ? $status[$value] : '';
    }
    public static function getshoptype(){
        $data_list = self::view('shop','shoptype,name')
            ->view('shop_type', 'shoptype', 'shop_type.id=shop.shoptype', 'left')
            ->select();
        return $data_list;
    }
    public static function getShopName($map=[]){
        $data_list = self::view('type_auditing','id,shopid,typename,status state')
            ->view('shop', 'name', 'type_auditing.shopid=shop.id', 'left')
            ->where($map)
            ->paginate();
        return $data_list;
    }


}